const e = require('express');
const mongoose = require('mongoose');

// 定义用户数据的 Schema（结构 + 校验）
// models/Admin.js
const adminSchema = new mongoose.Schema({
  username: { type: String, required: true, unique: true },
  password: { type: String, required: true },
  nickname: { type: String, default: '' },
  role: {
    type: String,
    enum: [
      'customer_service',    // 普通客服
      'reviewer',           // 审核员
      'editor',             // 责任编辑
      'super_admin'         // 高级管理员
    ],
    default: 'customer_service'
  },
  //新增在线状态
  status:{ type:String,enum:['online','offline','busy'] },
  avatar:{ type:String,default:''}
});



module.exports = mongoose.model('Admin', adminSchema);